//
// Created by Administrator on 2023/11/24.
//
#include "bits/stdc++.h"

using namespace std;
const int N = 110;
int a[N];

int main() {
    int n, m;
    cin >> n ;
    unordered_map<int, int> mp;

    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        mp[a[i]]++;
    }
    cin>>m;
    for (int i = 0; i < m; ++i) {
        int x;
        cin >> x;
        if (!mp[x])
            cout << "NO" << endl;
        else cout << "YES" << endl;
    }

}